const client = require('./client');

module.exports = async function () {
  const params = {
    RegionId: process.env.regionId,
    InstanceName: 'apiAutoDeployInstance',
    Description: '通过openApi创建的实例（用模板创建）',
    InternetMaxBandwidthIn: 100,
    InternetMaxBandwidthOut: 100,
    UniqueSuffix: true,
    PasswordInherit: true, // 是否继承镜像密码
    LaunchTemplateId: process.env.launchTemplateId,
  };

  const requestOption = {
    method: 'POST',
  };

  return await client.request('RunInstances', params, requestOption);
};
